<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加用户信息</title>
<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">

var index = 0;
var diao = [{'type':'部门','id':'bumen'},{'type':'职务','id':'zhiwu'}];
	$(document).ready(function(){
		dy();
	
	});
	
	function dy(){
		if(index<diao.length){
			getDDL(diao[index].type,diao[index].id);
			setTimeout('dy()',100);
			index++;
		}
	}
	function getDDL(type,id){
		var date = new Date();
		$.getJSON("byTypeDDL.action",{"ddl.typeType":type,"date":date.getTime()},function(data){
			var o = "#"+id;
			var obj=$(o);
   		 for ( var i = 0; i < data.length; i++) {
   			 $(obj).append('<option value="'+data[i].id+'">'+data[i].value+'</option>');
			 }
		});
	}

</script>

<link href="../css/table.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="table_full" id="addUser">
<form action="../saveUser.action" method="post" >
 <table width="100%" border="0">
		 <input type="hidden" name="user.usIsdlete" value="0" />
		  
			<tr>
				<td class="table_rightf">工号：</td>
			  <td class="tableleftf"><input type="text" name="user.usEmpid" /></td>
			</tr>
			<tr>
				<td class="table_rightf">员工姓名：</td>
			  <td class="tableleftf"><input type="text" name="user.usEmpname"/><br /></td>
			</tr>
			<tr>
				<td class="table_rightf">登录密码：</td>
			  <td class="tableleftf"><input type="password" name="user.usPass"/><br /></td>
			</tr>
			<tr>
				<td class="table_rightf">部门：</td>
				<td class="tableleftf">
				<select id="bumen" name="user.DDLByTypeDepartments.typeId">
				
				</select>
				</td>
			</tr>
			<tr>
				<td class="table_rightf">职务：</td>
				<td class="tableleftf">
				<select id="zhiwu" name="user.DDLByTypeDuties.typeId">
				
				</select>
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td class="tableleftf"><input type="submit" value ="  保 存  " />				  <input type="reset" value ="  重 置  " /></td>
			</tr>
			
		</table>	
  </form>
	</div>	

</body>
</html>